package show.lmm.testapp1.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;
import show.lmm.testapp1.conf.ServerConf;

@RestController("/")
public class IndexController {

    private final ServerConf serverConf;

    public IndexController(ServerConf serverConf) {
        this.serverConf = serverConf;
    }

    @GetMapping("/get/server_info")
    public Mono<String> getServerInfo(@RequestParam String info) {
        return Mono.just(String.format("testApp port:%d info:%s", serverConf.getPort(),info));
    }
}
